<?php

namespace app\logic\model\entity;

use app\logic\model\LogicModel;
use app\logic\model\user\UserLogicModel;
use think\model\concern\SoftDelete;

class EntityCommentLogicModel extends LogicModel
{
    use SoftDelete;
    protected $name='entity_comment';


    public function user(){
        return $this->hasOne(UserLogicModel::class,'id','user_id');
    }
    function create_comment($user_id,$goods_id,$type,$content){
        $this->save([
            'user_id'=>$user_id,
            'goods_id'=>$goods_id,
            'type'=>$type,
            'content'=>$content
        ]);
    }
}